const markerCamera = [
    {
        cood: [-1311859.04, 157380.48, 15.776337890625001],
        id: 'cctv-122',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm002.png',
    },
    {
        cood: [-1311793.76, 157421.19, 15.863583984375],
        id: 'cctv-121',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm002.png',
    },
    {
        cood: [-1311739.68, 157467.11000000002, 16.650283203125],
        id: 'safety-06',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
    {
        cood: [-1311638.56, 157605.48, 14.834970703125],
        id: 'safety-03',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
    {
        cood: [-1311698.56, 157643, 12.19333984375],
        id: 'cctv-117',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm002.png',
    },
    {
        cood: [-1311602.8800000001, 157739.14, 14.338583984375001],
        id: 'safety-05',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
    {
        cood: [-1311483.68, 157672.71, 5.53794921875],
        id: 'safety-10',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
    {
        cood: [-1311394.24, 157773.29, 10.295283203125],
        id: 'safety-08',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
    {
        cood: [-1311385.44, 157648.96, 10.2273046875],
        id: 'safety-09',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
    {
        cood: [-1311548.32, 157428.61000000002, 9.85806640625],
        id: 'safety-04',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
    {
        cood: [-1311619.2, 157441.86000000002, 1.604921875],
        id: 'safety-02',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
    {
        cood: [-1311590.24, 157497.99, 0.1409375],
        id: 'safety-01',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
    {
        cood: [-1311685.76, 157358.29, 10.2013671875],
        id: 'safety-07',
        camera: [-208.242427, -479.829375, 267.984941, 4.117081, -111.299286, 0.000001],
        vid: '1000018$1$0$85',
        image: 'm001.png',
    },
]

export const addMarkerCamera = async () => {
    __g.marker.clear()
    const path = window.location.origin;
    let arr = []
    for (let i = 0; i < markerCamera.length; i++) {
        const marker = {
            id: 'MCamera' + i,
            groupId: 'JK',
            userData: markerCamera[i].vid,
            coordinate: markerCamera[i].cood, //坐标位置
            coordinateType: 0, //默认0是投影坐标系，也可以设置为经纬度空间坐标系值为1
            anchors: [-16, 32], //锚点，设置Marker的整体偏移，取值规则和imageSize设置的宽高有关，图片的左上角会对准
            imageSize: [32, 32], //图片的尺寸
            hoverImageSize: [32, 32], //鼠标悬停时显示的图片尺寸
            range: [1, 100000], //可视范围
            imagePath: path + '/marker/' + markerCamera[i].image, //显示图片路径
            hoverImagePath: path + '/marker/' + markerCamera[i].image, //显示图片路径
            fixedSize: true, //图片固定尺寸，取值范围：false 自适应，近大远小，true 固定尺寸，默认值：false
            useTextAnimation: true, //关闭文字展开动画效果 打开会影响效率
            showLine: false, //标注点下方是否显示垂直牵引线
            autoHidePopupWindow: true, //失去焦点后是否自动关闭弹出窗口
            autoHeight: false, // 自动判断下方是否有物体
            displayMode: 2,
            clusterByImage: false, // 聚合时是否根据图片路径分类，即当多个marker的imagePath路
            priority: 0, //避让优先级
            occlusionCull: false //是否参与遮挡剔
        }
        arr.push(marker)
    }
    console.log(1)
    await __g.marker.add(arr);
}